package co.fitstart.entity.taste;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 一元尝鲜统计数据
 * @author haiyan_xiao
 *
 */
@Entity
@Table(name = "taste_stat")
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class TasteStat {
    @Id
    @GeneratedValue
    private Long id;
    
    /** 来源 */
    private String source;
    
    /** 统计日期 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @org.hibernate.annotations.Type(type = "date")
    private Date statDay;
    
    /** 统计小时 */
    private Integer statHour;
    
    /** 完成问卷数 */
    private int questionNum;
    
    /** 填写个人信息数 */
    private int profileNum;
    
    /** 下单量 */
    private int orderNum;
    
    public TasteStat() {
        
    }
    
    public TasteStat(String source, Date statDay, Integer statHour) {
        this.source = source;
        this.statDay = statDay;
        this.statHour = statHour;
        this.questionNum = 0;
        this.profileNum = 0;
        this.orderNum = 0;
    }
    
    /**
     * 
     * @return
     */
    public TasteStat addQuestion() {
        this.questionNum++;
        return this;
    }
    
    /**
     * 
     * @return
     */
    public TasteStat addProfile() {
        this.profileNum++;
        return this;
    }
    
    /**
     * 
     * @return
     */
    public TasteStat addOrder() {
        this.orderNum++;
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the source
     */
    public String getSource() {
        return source;
    }

    /**
     * @return the statDay
     */
    public Date getStatDay() {
        return statDay;
    }

    /**
     * @return the statHour
     */
    public Integer getStatHour() {
        return statHour;
    }

    /**
     * @return the questionNum
     */
    public int getQuestionNum() {
        return questionNum;
    }

    /**
     * @return the profileNum
     */
    public int getProfileNum() {
        return profileNum;
    }

    /**
     * @return the orderNum
     */
    public int getOrderNum() {
        return orderNum;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param source the source to set
     */
    public void setSource(String source) {
        this.source = source;
    }

    /**
     * @param statDay the statDay to set
     */
    public void setStatDay(Date statDay) {
        this.statDay = statDay;
    }

    /**
     * @param statHour the statHour to set
     */
    public void setStatHour(Integer statHour) {
        this.statHour = statHour;
    }

    /**
     * @param questionNum the questionNum to set
     */
    public void setQuestionNum(int questionNum) {
        this.questionNum = questionNum;
    }

    /**
     * @param profileNum the profileNum to set
     */
    public void setProfileNum(int profileNum) {
        this.profileNum = profileNum;
    }

    /**
     * @param orderNum the orderNum to set
     */
    public void setOrderNum(int orderNum) {
        this.orderNum = orderNum;
    }
}
